dir = Dir.open(".")
begin
  dir.each {|x|
     if x=~/.sql/ or x=~/.SQL/  
        port = open(x)
        begin
            port.each_line {|y|
               if y =~/CREATE/ 
                   puts y
                end
            }
        ensure
            port.close
        end
      end
  }
ensure
  dir.close
end

